module ComplaintsHelper
  def add_url_link(name)
    link_to_function name do |page|
      page.insert_html :bottom, :urls, :partial =>'url', :object =>Url.new
    end
  end
  def add_images_link(name)
    link_to_function name do |page|
      page.insert_html :bottom, :images, :partial =>'image', :object =>Image.new
    end
  end
  def add_company_link(name)
    link_to_function name do |page|
      page.insert_html :bottom, :companies, :partial =>'company', :object =>Company.new
    end
  end
  def add_company(name)
    link_to_function name do |page|
      company_name=page.literal "getCompanyName()"
      page.insert_html :bottom, :companies, :partial =>'company_hidden', :locals=>{:company_name=>company_name} 
    end
  end


end
